package com.suxin.spring.linked;

import org.springframework.security.web.util.matcher.RequestMatcher;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author Tang
 * @classname DefaultSecurityFilterChain
 * @description [  ]
 * @date 2022/8/29 13:18
 */
public class DefaultSecurityFilterChain implements SecurityFilterChain{

    private List<Filter> filters;

    private RequestMatcher requestMatcher;

    public DefaultSecurityFilterChain(List<Filter> filters, RequestMatcher requestMatcher) {
        this.filters = filters;
        this.requestMatcher = requestMatcher;
    }

    @Override
    public List<Filter> getFilters() {
        return this.filters;
    }

    @Override
    public boolean matches(HttpServletRequest request) {
        return requestMatcher.matches(request);
    }
}
